package core
{
import flash.events.Event;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;

import mx.core.WindowedApplication;
import mx.events.FlexEvent;

public class ConfigAppliacation extends WindowedApplication
{
	public var config:XML;
	
	public function ConfigAppliacation()
	{
		super();
		this.addEventListener(FlexEvent.PREINITIALIZE,loadConfig);
	}
	
	
	private function loadConfig(event:FlexEvent):void
	{
		var file:File = new File();
		//trace(File.applicationDirectory.nativePath)
		file.nativePath = File.applicationDirectory.nativePath + "\\config.xml";
		trace(file.nativePath)
		var fs:FileStream = new FileStream();
		fs.open( file, FileMode.READ );
		config = XML( fs.readMultiByte(file.size, File.systemCharset) );
		afterConfigLoaded();		
		fs.close();
	}
	
	
	protected function afterConfigLoaded():void
	{
		
	}

	
}
}